package com.gouldzd.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 预约设置
 */
public class OrderSetting implements Serializable{
    private Integer id ;
    private Date orderDate;//预约设置日期
    private int number;//可预约人数
    private int reservations ;//已预约人数
    private int date ;//根据月份查询对应的预约设置数据,封装前端需要的json数据格式

    public int getDate() {
        return date;
    }

    public void setDate(int date) {
        this.date = date;
    }

    public OrderSetting() {
    }

    public OrderSetting(Date orderDate, int number) {
        this.orderDate = orderDate;
        this.number = number;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
        //this.date = orderDate.getDate();//封装方式二:根据日期范围查询sql为:select * from时,可以此方法为date封装
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public int getReservations() {
        return reservations;
    }

    public void setReservations(int reservations) {
        this.reservations = reservations;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderSetting that = (OrderSetting) o;
        return Objects.equals(orderDate, that.orderDate);//批量操作预约日期服务
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orderDate, number, reservations);
    }
}
